package com.vken.blog.service.impl;

import com.vken.blog.dao.UserDao;
import com.vken.blog.model.User;
import com.vken.blog.service.UserManager;

public class UserManagerImpl implements UserManager {
	private UserDao userDao;

	public void changePassword(Integer userId, String newPassword) {
		User user = userDao.findById(userId);
		if (user != null) {
			user.setPassword(newPassword);
			userDao.update(user);
		}
	}

	public User get(String username, String password) {
		return userDao.get(username, password);
	}

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}
}
